package homework_04;

import java.util.Arrays;

/**
 * 数组去重
 */
public class Test_05 {
    public static void main(String[] args) {
        int[] arr = {1,3,2,3,2,3};
        int[] arr1 = arrCheck(arr);
        System.out.println(Arrays.toString(arr1));
    }

    public static int[] arrCheck(int[] arr){
        int[] arrTmp = Arrays.copyOfRange(arr,0,arr.length);
        for(int i=0;i<arr.length;i++){
            for(int j=i;j<arr.length;j++){
                if(i == j){
                    continue;
                }
                if(arr[i]==arr[j]){
                    arr[j] = 0;
                }
            }
        }
        return arr;
    }
}
